Field of the Invention
The present invention relates to a data processing method and data processing apparatus for dividing input data into a plurality of classes.
Description of the Related Art
Recently, a technique of dividing an image into a plurality of regions similar in an attribute such as color, texture, or coordinates is receiving attention. The divided region is called a superpixel. Since coding processing, image processing, and image recognition processing can be executed for each divided region, this technique is applicable to various image processing apparatuses.
Various methods have conventionally been proposed in regard to region segmentation of an image. In particular, there are proposed many methods of dividing an image into regions by clustering pixels. According to this method, data having a color, texture, and coordinates as elements are clustered based on the distance between elements. In clustering, representative data of each cluster is obtained, and input data is assigned to nearest-neighbor representative data. At this time, distances between the input data and a plurality of representative candidate data items are calculated to search for nearest-neighbor representative data. Related arts of region segmentation using clustering are proposed, for example, by the following literatures.    [patent literature 1] Japanese Patent No. 3611006    [non-patent literature 1] Radhakrishna Achanta, et al., “SLIC Superpixels Compared to State-of-the-Art Superpixel Methods,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, No. 11, pp. 2274-2282, November 2012    [non-patent literature 2] “Algorithmic Transformations in the Implementation of K-means Clustering on Reconfigurable Hardware”, Proceeding of International Symposium on Field Programmable Gate Arrays, pp. 103-110, 2001
Non-patent literature 1 proposes a method of performing region segmentation using a so-called SLIC (Simple Linear Iterative Clustering) clustering method. In SLIC, the search area of nearest-neighbor representative data in K-means clustering is restricted to a local region in an image. Calculation of a distance between input data and representative data of each class normally uses a Euclidian distance (L2 distance), but a method using a distance other than the Euclidian distance is also proposed. For example, non-patent literature 1 proposes a method in which the weighted distance of each element of data is used. Non-patent literature 2 proposes a method in which the linear sum of an L1 distance and an L∞ distance is used as a distance.
As described above, clustering is a technique well used in region segmentation of an image. In region segmentation, it is important that regions different in color and texture characteristics are separated. In clustering, it is therefore preferable that the distance between input data and representative candidate data in a region similar in color and texture characteristic is small and that in contrast, the distance between input data and representative candidate data in a region different in color and texture characteristic is large.
In the method described in non-patent literature 1, the linear sum of a color distance and a coordinate distance is used as a total distance. In non-patent literature 1, both the color distance and coordinate distance are Euclidian distances. However, if the Euclidian distance is used in calculation of the color distance, the color distance may not become so large even between regions different in color characteristic. For example, only a few color components become greatly different between regions, and the discrepancies of many other color components are small. In this case, since the discrepancies of many color components are small and the total color distance does not become large, the boundary accuracy between such regions becomes poor.
The method described in patent literature 1 can set different weights for all elements (color components) in distance calculation, so the boundary accuracy is considered to be improved in some cases, compared to the case in which the Euclidian distance is used. The method described in non-patent literature 2 uses the distance calculation method of the L1 distance and L∞ distance different in characteristic from the Euclidian distance, and the boundary accuracy is thus considered to be improved, compared to the case in which the Euclidian distance is used. However, neither of these methods considers the characteristic of input data, and the coefficient of the weight or linear sum is fixed regardless of input data. This poses a problem that the boundary accuracy becomes poor depending on a processing target image.